package com.heny.demo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import org.locationtech.jts.geom.Coordinate;
import org.locationtech.jts.geom.GeometryFactory;
import org.locationtech.jts.geom.Point;

/**
 * @author :Yozuru
 * @since :2024/9/14 17:19
 */
@TableName("turn_point")
public class TurnPoint {
    @TableId(type = IdType.AUTO)
    private Integer id;
    private Point coordinate;
    private String index;

    // 工厂方法：创建 Point 对象
    public static Point createPoint(double x, double y, double z) {
        GeometryFactory geometryFactory = new GeometryFactory();
        Coordinate coordinate = new Coordinate(x, y, z);
        return geometryFactory.createPoint(coordinate);
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Point getCoordinate() {
        return coordinate;
    }

    public void setCoordinate(Point coordinate) {
        this.coordinate = coordinate;
    }

    public String getIndex() {
        return index;
    }

    public void setIndex(String index) {
        this.index = index;
    }
}
